class CreateFetions < ActiveRecord::Migration
  def self.up
    add_column :users, :fetion_id, :integer
    create_table :fetions do |t|
      t.string :name
      t.string :mobile
      t.string :encrypted_password
      t.integer :max_users_count, :default => 300
      t.integer :users_count, :default => 0
      t.string :status, :default => 'LOGOUT'
      t.datetime :logined_at 
      t.integer :unread_application_confirmed_messages_count,
        :unread_buddy_application_messages_count,
        :unread_buddy_state_messages_count,
        :unread_buddy_messages_count,
        :unread_client_state_messages_count,
        :default => 0
      t.timestamps
    end
        
  end

  def self.down
    remove_column :users, :fetion_id
    drop_table :fetions
  end
end
